// 生成随机日期（2023年7月1日至7月10日之间）
function randomDate() {
  const startDate = new Date(2023, 6, 1);
  const endDate = new Date(2023, 6, 10);
  const timestamp = startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime());
  return new Date(timestamp).toISOString().substr(0, 10);
}

// 生成随机数量（10至50之间）
function randomQuantity() {
  return Math.floor(Math.random() * 41) + 10;
}

// 生成随机的采购、入库和出库记录
const purchaseRecords = [];
const stockInRecords = [];
const stockOutRecords = [];

for (let i = 0; i < 10; i++) {
  const date = randomDate();
  const purchaseQuantity = randomQuantity();
  const stockInQuantity = randomQuantity();
  const stockOutQuantity = randomQuantity();

  purchaseRecords.push({ date, quantity: purchaseQuantity });
  stockInRecords.push({ date, quantity: stockInQuantity });
  stockOutRecords.push({ date, quantity: stockOutQuantity });
}

export { purchaseRecords, stockInRecords, stockOutRecords };
